﻿using System.Windows;
using EventAggregator;

namespace EAWpfSample
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        private MyApp _myApp;

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            _myApp = new MyApp();

            Current.MainWindow = new MainWindow {DataContext = new MainWindowViewModel()};

            this.Send(EventId.Default.AppStartup);
        }

        protected override void OnExit(ExitEventArgs e)
        {
            base.OnExit(e);

            this.Send(EventId.Default.AppShutdown);
        }
    }
}